package com.imooc.order.repository;

import com.imooc.order.dataobject.OrderMaster;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @author steve
 * @date 2020/6/16 11:02
 */
public interface OrderMasterRepository extends JpaRepository<OrderMaster, String> {


    /**
     * 根据openid分页查询订单数据
     * @param buyerOpenid 用户微信openid
     * @param pageable 分页数据
     * @return Page<OrderMaster> 分页对象
     */
    Page<OrderMaster> findByBuyerOpenid(String buyerOpenid, Pageable pageable);

    /**
     * 根据订单id查找订单数据
     * @param orderId 订单id
     * @return 订单数据
     */
    OrderMaster findByOrderId(String orderId);
}
